<?php


namespace app\api\controller\uniapp;


use app\api\model\ShopYiwu;
use app\api\model\Users;
use app\common\controller\Api;
use app\api\controller\Wxutils;
use app\api\model\Region;
use think\Config;
use think\Db;

/**
 * 小程序首页接口
 * Class Index
 * @package app\api\controller\uniapp
 */
class Mine extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];
    protected $service = null;

    public function _initialize()
    {
        parent::_initialize();
        $version = str_replace(".","",$this->version);
        $className = basename(__CLASS__);
        $serviceName = "app\\api\\service\\uniapp\\mine\\Mine{$version}";
        $this->service = new $serviceName;
    }

    /**
     * 我的页面首页
     * @return mixed
     */
    public function index(){
        return $this->service->load_mine();
    }

    /**
     * 获取工作台数据
     */
    public function load_work(){
        return $this->service->load_work();
    }

    /**
     * 获取分公司数据
     * @return mixed
     */
    public function load_office(){
        return $this->service->load_office();
    }

    public function getcoupon(){
        return $this->service->getcoupon();
    }

    public function getred(){
        return $this->service->getred();
    }
}